<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen 2.8.0" />

	<title>Class DateNow | sweetphp</title>

	<script type="text/javascript" src="resources/combined.js?2802521858"></script>
	<script type="text/javascript" src="elementlist.js?3776638906"></script>
	<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />

</head>

<body>
<div id="left">
	<div id="menu">
		<a href="index.html" title="Overview"><span>Overview</span></a>


		<div id="groups">
			<h3>Packages</h3>
			<ul>
				<li><a href="package-PHP.html">PHP</a>
						</li>
				<li class="active"><a href="package-SweetPHP.html">SweetPHP<span></span></a>
						<ul>
				<li class="active"><a href="package-SweetPHP.System.html">System<span></span></a>
						<ul>
				<li><a href="package-SweetPHP.System.Core.html">Core</a>
						</li>
				<li><a href="package-SweetPHP.System.Test.html">Test</a>
						</li>
				<li class="active"><a href="package-SweetPHP.System.Utility.html">Utility</a>
						</li>
							</ul></li></ul></li>
			</ul>
		</div>

		<hr />


		<div id="elements">
			<h3>Classes</h3>
			<ul>
				<li><a href="class-DataParam.html">DataParam</a></li>
				<li class="active"><a href="class-DateNow.html">DateNow</a></li>
				<li><a href="class-Dir.html">Dir</a></li>
				<li><a href="class-Float.html">Float</a></li>
				<li><a href="class-Form.html">Form</a></li>
				<li><a href="class-Helpers.html">Helpers</a></li>
				<li><a href="class-InputText.html">InputText</a></li>
				<li><a href="class-Integer.html">Integer</a></li>
				<li><a href="class-Logger.html">Logger</a></li>
				<li><a href="class-Mask.html">Mask</a></li>
				<li><a href="class-SEO.html">SEO</a></li>
				<li><a href="class-Session.html">Session</a></li>
				<li><a href="class-String.html">String</a></li>
			</ul>





		</div>
	</div>
</div>

<div id="splitter"></div>

<div id="right">
<div id="rightInner">
	<form id="search">
		<input type="hidden" name="cx" value="" />
		<input type="hidden" name="ie" value="UTF-8" />
		<input type="text" name="q" class="text" />
		<input type="submit" value="Search" />
	</form>

	<div id="navigation">
		<ul>
			<li>
				<a href="index.html" title="Overview"><span>Overview</span></a>
			</li>
			<li>
				<a href="package-SweetPHP.System.Utility.html" title="Summary of SweetPHP\System\Utility"><span>Package</span></a>
			</li>
			<li class="active">
<span>Class</span>			</li>
		</ul>
		<ul>
			<li>
				<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
			</li>
		</ul>
		<ul>
		</ul>
	</div>

<div id="content" class="class">
	<h1>Class DateNow</h1>


	<div class="description">
	SweetPHP<br />

<p><b>DateNow</b></p>

<p>Datas</p>
<br />

	</div>

	<dl class="tree">
		<dd style="padding-left:0px">
DataHoje
			
			
		</dd>
		<dd style="padding-left:30px">
			<img src="resources/inherit.png" alt="Extended by" />
<b><span>DateNow</span></b>			
			
			
		</dd>
	</dl>








	<div class="info">
		
		
		
		<b>Package:</b> <a href="package-SweetPHP.html">SweetPHP</a>\<a href="package-SweetPHP.System.html">System</a>\<a href="package-SweetPHP.System.Utility.html">Utility</a><br />

				<b>Copyright:</b>
				Copyright (c) 2013 - 2014, Ilines.<br />
				<b>Author:</b>
				sweetphp<br />
		<b>Located at</b> <a href="source-class-DateNow.html#3-337" title="Go to source code">libs/system/utility/DateNow.php</a><br />
	</div>



	<table class="summary" id="methods">
	<caption>Methods summary</caption>
	<tr data-order="datePeriodString" id="_datePeriodString">

		<td class="attributes"><code>
			 public static
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_datePeriodString">#</a>
		<code><a href="source-class-DateNow.html#20-42" title="Go to source code">datePeriodString</a>( <span>mixed <var>$dataIn</var> = <span class="php-quote">&quot;&quot;</span></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="Add" id="_Add">

		<td class="attributes"><code>
			 public static
			<code><a href="class-DateTime.html">DateTime</a></code>
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Add">#</a>
		<code><a href="source-class-DateNow.html#44-60" title="Go to source code">Add</a>( <span><code><a href="class-DateTime.html">DateTime</a></code> <var>$date</var> = <span class="php-quote">&quot;&quot;</span></span>, <span>(Integet) <var>$add</var> = <span class="php-num">0</span></span>, <span>(String) <var>$default</var> = <span class="php-quote">&quot;D&quot;</span></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$date</var></dt>
					<dd><code><code><a href="class-DateTime.html">DateTime</a></code></code><br>$date</dd>
					<dt><var>$add</var></dt>
					<dd><code>(Integet)</code><br>$add</dd>
					<dt><var>$default</var></dt>
					<dd><code>(String)</code><br>$default</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code><code><a href="class-DateTime.html">DateTime</a></code></code><br />
				</div>


				<h4>Link</h4>
				<div class="list">
						<a href="http://www.php.net/manual/en/datetime.add.php">DateNow::Add</a><br />
				</div>
				<h4>Tutorial</h4>
				<div class="list">
						use -&gt; add (5) + default (y, m, d, h, i, s)<br />
				</div>


		</div>
		</div></td>
	</tr>
	<tr data-order="Sub" id="_Sub">

		<td class="attributes"><code>
			 public static
			<code><a href="class-DateTime.html">DateTime</a></code>
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_Sub">#</a>
		<code><a href="source-class-DateNow.html#62-78" title="Go to source code">Sub</a>( <span><code><a href="class-DateTime.html">DateTime</a></code> <var>$date</var> = <span class="php-quote">&quot;&quot;</span></span>, <span>(Integet) <var>$remove</var> = <span class="php-num">0</span></span>, <span>(String) <var>$default</var> = <span class="php-quote">&quot;days&quot;</span></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$date</var></dt>
					<dd><code><code><a href="class-DateTime.html">DateTime</a></code></code><br>$date</dd>
					<dt><var>$remove</var></dt>
					<dd><code>(Integet)</code><br>$add</dd>
					<dt><var>$default</var></dt>
					<dd><code>(String)</code><br>$default</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code><code><a href="class-DateTime.html">DateTime</a></code></code><br />
				</div>


				<h4>Link</h4>
				<div class="list">
						<a href="http://www.php.net/manual/en/datetime.sub.php">DateNow::Sub</a><br />
				</div>
				<h4>Tutorial</h4>
				<div class="list">
						use -&gt; add (5) + default (days, y, m, d, h, i, s)<br />
				</div>


		</div>
		</div></td>
	</tr>
	<tr data-order="dateTime" id="_dateTime">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_dateTime">#</a>
		<code><a href="source-class-DateNow.html#80-83" title="Go to source code">dateTime</a>( )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="getDateNow" id="_getDateNow">

		<td class="attributes"><code>
			 public static
			type
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_getDateNow">#</a>
		<code><a href="source-class-DateNow.html#85-95" title="Go to source code">getDateNow</a>( <span>type <var>$default</var> = <span class="php-quote">&quot;us&quot;</span></span>, <span>type <var>$delim</var> = <span class="php-quote">&quot;-&quot;</span></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			


				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$default</var></dt>
					<dd><code>type</code><br>$default = us, option -&gt; br</dd>
					<dt><var>$delim</var></dt>
					<dd><code>type</code><br>$delim</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>type</code><br>date<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="getHourNow" id="_getHourNow">

		<td class="attributes"><code>
			 public static
			type
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_getHourNow">#</a>
		<code><a href="source-class-DateNow.html#97-117" title="Go to source code">getHourNow</a>( <span>type <var>$default</var> = <span class="php-quote">&quot;hms&quot;</span></span>, <span>type <var>$delim</var> = <span class="php-quote">&quot;-&quot;</span></span> )</code>

		<div class="description short">
			
<p>$default = H:s:m, set new $default to hm = H:m return H:m</p>

		</div>

		<div class="description detailed hidden">
			
<p>$default = H:s:m, set new $default to hm = H:m return H:m</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$default</var></dt>
					<dd><code>type</code><br>$default</dd>
					<dt><var>$delim</var></dt>
					<dd><code>type</code><br>$delim types ( - , / . | _ and others</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>type</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="live" id="_live">

		<td class="attributes"><code>
			 public static
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_live">#</a>
		<code><a href="source-class-DateNow.html#119-122" title="Go to source code">live</a>( <span>mixed <var>$paramData</var> = <span class="php-quote">&quot;&quot;</span></span>, <span>mixed <var>$date</var> = <span class="php-quote">&quot;&quot;</span></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="curdate" id="_curdate">

		<td class="attributes"><code>
			 public static
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_curdate">#</a>
		<code><a href="source-class-DateNow.html#124-126" title="Go to source code">curdate</a>( )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="dataAtualUniversal" id="_dataAtualUniversal">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_dataAtualUniversal">#</a>
		<code><a href="source-class-DateNow.html#128-141" title="Go to source code">dataAtualUniversal</a>( )</code>

		<div class="description short">
			
<p>Fun��o que retorna a data atual no padraoIngl�s (YYYY-MM-DD):
Utilizado: dataAtualUniversal();</p>

		</div>

		<div class="description detailed hidden">
			
<p>Fun��o que retorna a data atual no padraoIngl�s (YYYY-MM-DD):
Utilizado: dataAtualUniversal();</p>








		</div>
		</div></td>
	</tr>
	<tr data-order="curhour" id="_curhour">

		<td class="attributes"><code>
			 public static
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_curhour">#</a>
		<code><a href="source-class-DateNow.html#143-150" title="Go to source code">curhour</a>( )</code>

		<div class="description short">
			
<p>FUNCAO QUE RETORNA A HORA ATUAL (Hora e Minuto) Utilizado: curhour();</p>

		</div>

		<div class="description detailed hidden">
			
<p>FUNCAO QUE RETORNA A HORA ATUAL (Hora e Minuto) Utilizado: curhour();</p>








		</div>
		</div></td>
	</tr>
	<tr data-order="curtime" id="_curtime">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_curtime">#</a>
		<code><a href="source-class-DateNow.html#152-159" title="Go to source code">curtime</a>( )</code>

		<div class="description short">
			
<p>FUNCAO HORA ATUAL COMPLETA (Hora / Minuto / Segundo) Utilizado:
horaAtualCompleta;</p>

		</div>

		<div class="description detailed hidden">
			
<p>FUNCAO HORA ATUAL COMPLETA (Hora / Minuto / Segundo) Utilizado:
horaAtualCompleta;</p>








		</div>
		</div></td>
	</tr>
	<tr data-order="validDate" id="_validDate">

		<td class="attributes"><code>
			 public 
			&lt;validaData&gt;
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_validDate">#</a>
		<code><a href="source-class-DateNow.html#161-213" title="Go to source code">validDate</a>( <span>DateNow; <var>$data</var></span>, <span>string <var>$tipo</var> = <span class="php-quote">&quot;pt&quot;</span></span> )</code>

		<div class="description short">
			
<p>FUNCAO QUE VALIDA A DATA Esta funcao faz todas a verifica��es
necess�rias como verificar se o mes est� entre 2 e 22, verificar se o dia
est� dentro dos dias permitidos para aquele mes (leva em considera��o os
anos bissextos) e verificar se o ano � v�lido. OBS.: As datas enviadas podem
estar no formato ingl�s (en) ou brasileiro (pt). Utilizado:</p>

		</div>

		<div class="description detailed hidden">
			
<p>FUNCAO QUE VALIDA A DATA Esta funcao faz todas a verifica��es
necess�rias como verificar se o mes est� entre 2 e 22, verificar se o dia
est� dentro dos dias permitidos para aquele mes (leva em considera��o os
anos bissextos) e verificar se o ano � v�lido. OBS.: As datas enviadas podem
estar no formato ingl�s (en) ou brasileiro (pt). Utilizado:</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$data</var></dt>
					<dd><code>DateNow;</code></dd>
					<dt><var>$tipo</var></dt>
					<dd><code>string</code><br>Validar data no formato brasileiro (dd/mm/yyyy):</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>&lt;validaData&gt;</code><br>('27/07/2009', 'pt');<br />
					<code>&lt;validaData&gt;</code><br>('2009-07-27', 'en');<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="weekday" id="_weekday">

		<td class="attributes"><code>
			 public static
			string
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_weekday">#</a>
		<code><a href="source-class-DateNow.html#215-232" title="Go to source code">weekday</a>( <span>type <var>$date</var> = <span class="php-quote">&quot;&quot;</span></span>, <span>type <var>$abb</var> = <span class="php-keyword1">false</span></span> )</code>

		<div class="description short">
			
<p><b>Weekday</b></p>

		</div>

		<div class="description detailed hidden">
			
<p><b>Weekday</b></p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$date</var></dt>
					<dd><code>type</code><br>$date</dd>
					<dt><var>$abb</var></dt>
					<dd><code>type</code><br>$abb</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>string</code><br>weekday abbreviate if $abb = true<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="listaDia" id="_listaDia">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_listaDia">#</a>
		<code><a href="source-class-DateNow.html#234-246" title="Go to source code">listaDia</a>( <span>mixed <var>$dia</var></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="listMonth" id="_listMonth">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_listMonth">#</a>
		<code><a href="source-class-DateNow.html#248-267" title="Go to source code">listMonth</a>( <span>type <var>$month</var></span>, <span>type <var>$abb</var> = <span class="php-keyword1">false</span></span> )</code>

		<div class="description short">
			
<p><b>Month List</b></p>

		</div>

		<div class="description detailed hidden">
			
<p><b>Month List</b></p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$month</var></dt>
					<dd><code>type</code><br>$month</dd>
					<dt><var>$abb</var></dt>
					<dd><code>type</code><br>$abb = abbreviated month -&gt; default = false</dd>
				</dl></div>





		</div>
		</div></td>
	</tr>
	<tr data-order="listaAno" id="_listaAno">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_listaAno">#</a>
		<code><a href="source-class-DateNow.html#269-277" title="Go to source code">listaAno</a>( <span>mixed <var>$ano</var></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="constructDateToMySQL" id="_constructDateToMySQL">

		<td class="attributes"><code>
			 public 
			2011-12-31
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_constructDateToMySQL">#</a>
		<code><a href="source-class-DateNow.html#279-327" title="Go to source code">constructDateToMySQL</a>( <span>mixed <var>$day</var></span>, <span>mixed <var>$month</var></span>, <span>mixed <var>$year</var></span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			



				<h4>Returns</h4>
				<div class="list">
					<code>2011-12-31</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="setDateTime" id="_setDateTime">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_setDateTime">#</a>
		<code><a href="source-class-DateNow.html#329-331" title="Go to source code">setDateTime</a>( )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="getDateTime" id="_getDateTime">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_getDateTime">#</a>
		<code><a href="source-class-DateNow.html#333-335" title="Go to source code">getDateTime</a>( )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	</table>








	<table class="summary" id="constants">
	<caption>Constants summary</caption>
	<tr data-order="DATE_TIME_FORMAT" id="DATE_TIME_FORMAT">

		<td class="attributes"><code>string</code></td>
		<td class="name"><code>
				<a href="source-class-DateNow.html#16" title="Go to source code"><b>DATE_TIME_FORMAT</b></a>
		</code></td>
		<td class="value"><code><span class="php-quote">&quot;Y-m-d H:i:s&quot;</span></code></td>
		<td class="description"><div>
			<a href="#DATE_TIME_FORMAT" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="DATE_FORMAT" id="DATE_FORMAT">

		<td class="attributes"><code>string</code></td>
		<td class="name"><code>
				<a href="source-class-DateNow.html#17" title="Go to source code"><b>DATE_FORMAT</b></a>
		</code></td>
		<td class="value"><code><span class="php-quote">&quot;Y-m-d&quot;</span></code></td>
		<td class="description"><div>
			<a href="#DATE_FORMAT" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="TIME_FORMAT" id="TIME_FORMAT">

		<td class="attributes"><code>string</code></td>
		<td class="name"><code>
				<a href="source-class-DateNow.html#18" title="Go to source code"><b>TIME_FORMAT</b></a>
		</code></td>
		<td class="value"><code><span class="php-quote">&quot;H:i:s&quot;</span></code></td>
		<td class="description"><div>
			<a href="#TIME_FORMAT" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	</table>




	<table class="summary" id="properties">
	<caption>Properties summary</caption>
	<tr data-order="dateTime" id="$dateTime">
		<td class="attributes"><code>
			public  
			string
		</code></td>

		<td class="name">
				<a href="source-class-DateNow.html#14" title="Go to source code"><var>$dateTime</var></a>
		</td>
		<td class="value"><code><span class="php-quote">&quot;&quot;</span></code></td>
		<td class="description"><div>
			<a href="#$dateTime" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	</table>






</div>

	<div id="footer">
		sweetphp API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
	</div>
</div>
</div>
</body>
</html>
